from Base import Base
from selenium.webdriver.common.by import By
class Page(Base):
    # 登录
    # 输入用户名
    name = (By.XPATH, "/html/body/div/div/section/section/main/div[1]/div[2]/div[1]/div/input")
    # 输入密码
    pwd = (By.XPATH, "/html/body/div/div/section/section/main/div[1]/div[2]/div[2]/div/input")
    # 点击登录按钮
    login_button = (By.XPATH, "/html/body/div/div/section/section/main/div[1]/div[2]/button[2]")

    def name_input(self):
        self.send_keys(self.name, 'linglin')

    def pwd_input(self):
        self.send_keys(self.pwd, '123456Aa')

    def login(self):
        self.click(self.login_button)


    """
    添加
    """
    add_loc=(By.XPATH,'//*[@id="app"]/div/section/section/main/form/div/div[3]/div/div/button[2]')
    student_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[1]/div/div/div/input')

    operte_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[2]/div/div[1]/div/input')
    teacher_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[3]/div/div/div/input')
    # 提交
    button_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[4]/div/button[1]')

    # 添加
    def add(self):
        self.click(self.add_loc)
    def studen_input(self):
        self.send_keys(self.student_loc, 'linglin01')
    def operte(self):
        self.send_keys(self.operte_loc, 'aa')
    def teacher(self):
        self.send_keys(self.teacher_loc, 1)
    def button(self):
        self.click(self.button_loc)
    """
        修改
    """
    xiugai_bution=(By.XPATH,'/html/body/div[1]/div/section/section/main/div[1]/div/div[1]/div[3]/div/div[1]/div/table/tbody/tr[1]/td[8]/div/b[1]/button')
    name_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[1]/div/div/div/input')
    age_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[2]/div/div/div/input')
    six_loc = (By.XPATH, '/html/body/div[1]/div/section/section/main/form/div[3]/div/div/div/input')
    classe_loc = (By.XPATH, '/html/body/div[1]/div/section/section/main/form/div[4]/div/div/div/input')
    gx_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[5]/div/button[1]')

    def xiugai(self):
        self.click(self. xiugai_bution)
    def name01(self):
        self.send_keys(self.name_loc, 'lingli')
    def age(self):
        self.send_keys(self.age_loc, '11')

    def six(self):
        self.send_keys(self.six_loc, '1')

    def classe(self):
        self.send_keys(self.classe_loc, '1')

    def gx(self):
        self.click(self.gx_loc)




